a11y: Rework accessible name/description computation
authorEmmanuele Bassi <ebassi@gnome.org>
Fri, 16 Oct 2020 16:03:50 +0000 (17:03 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Mon, 19 Oct 2020 16:54:14 +0000 (17:54 +0100)
commit7c7dabae8c4ee5655fe0c9b12b318675b41ac11f
tree5901b9cb124a0562fea143c584596948d04d4324
parent94729b4880230dba7db41a710253c21bdd5d6c96
a11y: Rework accessible name/description computation

The ARIA spec determines the name and description of accessible elements
in a more complex way that simply mapping to a single property; instead,
it will chain up multiple definitions (if it finds them). For instance,
let's assume we have a button that saves a file selected from a file
selection widget; the widgets have the following attributes:

 - the file selection widget has a "label" attribute set to the
   selected file, e.g. "Final paper.pdf"
 - the "download" button has a "label" attribute set to the
   "Download" string
 - the "download" button has a "labelled-by" attribute set to
   reference the file selection widget

The ARIA spec says that the accessible name of the "Download" button
should be computed as "Download Final paper.pdf".

The algorithm defined in section 4.3 of the WAI-ARIA specification
applies to both accessible names (using the "label" and "labelled-by"
attributes), and to accessible descriptions (using the "description" and
"described-by" attributes).
gtk/a11y/gtkatspicontext.c
gtk/gtkatcontext.c
gtk/gtkatcontextprivate.h